package com.yangj.entity;

public class AccessToken
{
    private String accessToken;
    private long expireTime;
    
    public String getAccessToken() {
        return this.accessToken;
    }
    
    public void setAccessToken(final String accessToken) {
        this.accessToken = accessToken;
    }
    
    public long getExpireTime() {
        return this.expireTime;
    }
    
    public AccessToken(final String accessToken, final String expireIn) {
        this.accessToken = accessToken;
        this.expireTime = System.currentTimeMillis() + Integer.parseInt(expireIn) * 1000;
    }
    /*
     * 判断token是否过期
     * */
    public boolean isExpired() {
        return System.currentTimeMillis() > this.expireTime;
    }
}
